﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Pavilion
{
    public abstract class GameToolBase : IPropertyChanged
    {
        public event PropertyChangedHandler PropertyChanged;

        public GameItem ParentGameItem { get; private set; }

        public GameToolBase(GameItem parentGameItem)
        {
            this.ParentGameItem = parentGameItem;
        }

        public virtual void Dispose() { ParentGameItem = null; }

        public virtual void Load() { }

        public virtual void UpdateProperty(string propertyName, object propertyValue) { }

        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, propertyName);
        }
    }
}
